import request from '@/utils/request.js'
export const userRegisterService = ({ username, password, repassword }) => {
  return request.post('/api/reg', { username, password, repassword })
}
//登入请求
export const userLoginService = (loginObj) => {
  return request.post('/api/login', loginObj)
}
//获取用户信息
export const userGetInfoService = () => {
  return request.get('/my/userinfo')
}
//更改用户信息
export const userUpdateInfoService = ({ id, nickname, email }) => {
  return request.put('/my/userinfo', { id, nickname, email })
}
//上传头像
export const userUploadAvatarService = (avatar) => {
  return request.patch('/my/update/avatar', { avatar })
}
//更改密码
export const userUpdatePassService = ({ old_pwd, new_pwd, re_pwd }) => {
  return request.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
}
